<?php
define('BASE_DIR', dirname(__FILE__)."/..");

require BASE_DIR.'/include/define.inc.php';
require BASE_DIR.'/include/setting.inc.php';

require BASE_DIR.'/ajax/Epic.php';

//Epic_Loader_Autoloader::getInstance();
function __autoload($class) {
	$path = str_replace('_', '/', $class);
	$file = $path . ".php";
	include $file;
	if (!class_exists($class, false) && !interface_exists($class, false)) {
		require 'Epic/Loader/Exception.php';
		throw new Epic_Loader_Exception('The requested class or interface: ' . $class . ' was not found.');
	}
}

// for deleter journal  from admin/journal/list
if (isset($_POST['sendValueJournal'])){
	$id_journal = $_POST['sendValueJournal'];
	Epic::getModel('admin/journal')->delete($id_journal);
	echo json_encode(array("returnValue"=>"ok"));
}

// for deleter topic  from admin/topic/list 
if (isset($_POST['sendValueTopic'])){
	$id_journal = $_POST['sendValueTopic'];
	Epic::getModel('admin/topic')->delete($id_journal);
	echo json_encode(array("returnValue"=>"ok"));
}

// for deleter topic  from admin/acc/user 
if (isset($_POST['sendValueUser'])){
	$id_journal = $_POST['sendValueUser'];
	Epic::getModel('admin/user')->delete($id_journal);
	echo json_encode(array("returnValue"=>"ok"));
}

// for deleter topic  from admin/acc/user 
if (isset($_POST['sendValueEmployee'])){
	$id_journal = $_POST['sendValueEmployee'];
	Epic::getModel('admin/admin')->delete($id_journal);
	echo json_encode(array("returnValue"=>"ok"));
}